#!/bin/bash

SRC_BRANCH=master
RELEASE_BRANCH=`git branch | grep "*" | awk '{print $2}'`

echo "git branch" $RELEASE_BRANCH
sleep 1

git checkout $SRC_BRANCH
git pull origin $SRC_BRANCH
git checkout $RELEASE_BRANCH
git merge $SRC_BRANCH
git pull origin $RELEASE_BRANCH

. name
. /root/bin/name-sample

echo $name
echo $image_name

docker build -t $image_name .
docker push $image_name

echo $image_name
mkdir -p versions/
echo $image_name >  versions/${version}
